{extend name="public/common"} {block name="body"}
<title>基本设置</title>
</head>
<style type="text/css">
.bg-1 {
    height: 40px;
    background-color: #e5e5e5 !important;
    border-bottom: 1px solid #e4e7ed;
}
 .radius:hover{
 	background:#e5e5e5;
 	border-color: #e5e5e5;
 	color: #333;
 }
 span:hover{
 	color: #333;
 }
 .line{
 	position: absolute;
		    right: 0;
		    top: 13px;
		    background: #636363;
		    width: 1px;
		    height: 14px;
		    overflow: hidden;
 }
 .radius{
 	position: relative;
 }
 .text-c td a {
    text-decoration: none !important;
    color: #333;
}
</style>
<body>
  <nav class="breadcrumb">
    <i class="Hui-iconfont">&#xe67f;</i>
    注单管理
    <span class="c-gray en">&gt;</span>
投注记录
 
    <span class="c-gray en">&gt;</span>
    {$title}
    <a class="btn btn-success radius r"
      style="line-height: 1.6em; margin-top: 3px"
      href="javascript:location.replace(location.href);" title="刷新">
      <i class="Hui-iconfont">&#xe68f;</i>
    </a>
  </nav>
  
  <div style="padding:20px;height:30px;">
  	
  	<div class="new_box">
  <div style="height: 40px;background-color: #e5e5e5 !important;border-bottom: 1px solid #e4e7ed;margin-bottom: 45px;">
    <div style="float:left;">
      <a class="btn btn-primary radius"  href="{:url('Betting/tz_list')}?ticker=0&limit={$limit}&us_sql={$param.us_sql}" {if($ticker==0)}style="background: #636363;border-color: #636363;color: #fff;margin-left: -1px;"{/if}>未结算投注记录<span class="line">◆</span></a>
      <a class="btn btn-primary radius"  href="{:url('Betting/tz_list')}?ticker=3&limit={$limit}&us_sql={$param.us_sql}" {if($ticker==3)}style="background:#636363;border-color: #636363;color: #fff;margin-left: -1px;"{/if}>追号投注未结算记录<span class="line">◆</span></a>
      <a class="btn btn-primary radius"  href="{:url('Betting/tz_list')}?ticker=1&limit={$limit}&us_sql={$param.us_sql}" {if($ticker==1)}style="background: #636363;border-color: #636363;color: #fff;margin-left: -1px;"{/if}>已结算投注记录<span class="line">◆</span></a>
      <a class="btn btn-primary radius"  href="{:url('Betting/tz_list')}?ticker=2&limit={$limit}&us_sql={$param.us_sql}" {if($ticker==2)}style="background: #636363;border-color: #636363;color: #fff;margin-left: -1px;"{/if}>试玩内部账号结算记录</a>
      
    </div>
    <div style="float:right;height: 40px;line-height: 40px;"><span style="margin-right:10px;font-size:16px;">当前页总投注额：<strong style="color:red;">{$cur_je|default=0.00}</strong></span> {if ($ticker!=0 && $ticker!=3)}<span style="font-size:16px;margin-right:10px;">当前页总派彩：<strong style="color:red;">{$pcje|default=0.00}</strong></span>{/if}<span style="font-size:16px;margin-right:10px;">当前区间总投注额：<strong style="color:red;">{$qjje|default=0.00}</strong></span>
    {if ($ticker!=0 && $ticker!=3)}<span style="font-size:16px;"> 当前区间总派彩：<strong style="color:red;">{$zjje|default=0.00}</strong></span>{/if}
    </div>
  </div>
  <div class="text-c" style="padding :20px 0;">
    <form action="" enctype="application/x-www-form-urlencoded" method="get" class="l" style="margin-left:20px;">
    <div  style="width:217px;" class="formControls col-xs-8 col-sm-9"> 
    	<span class="select-box">
			<select class="select" name="czid">
			<option value="0">全部彩种</option>
			{volist name="caizhong" id="vo"}
				<option value="{$vo.id}" {if condition="input('get.czid') == $vo.id"}selected{/if}>{$vo.cp_name_new ? $vo.cp_name_new : $vo.cp_name_old}</option>
			{/volist}
			</select>
		</span> 
	</div>
    <input type="text" name="qihao_sql" id="qihao_sql" value="{$param.qihao_sql}" placeholder=" 期号" style="width:150px" class="input-text">
    <input type="hidden" name="ticker" value="{$ticker}">
     &nbsp;&nbsp;&nbsp;&nbsp;从：
    <input type="text" name="sDate1" value="{:input('get.sDate1')}" id="sDate1" onfocus="WdatePicker({maxDate:'%y-%M-%d'})"  class="input-text Wdate" style="width:120px;">
     到：
    <input type="text" onfocus="WdatePicker({maxDate:'%y-%M-%d'})" name="sDate2" value="{:input('get.sDate2')}"  id="sDate2"  class="input-text Wdate" style="width:120px;margin-right:15px;">
    <input type="text" id="us_sqlus_sql" name="us_sql" value="{$param.us_sql}" placeholder=" 会员名称" style="width:150px" class="input-text">
    <input type="hidden" name="limit" value="{$limit}"  style="width:150px" class="input-text">
    <button class="btn btn-success" type="submit" style="margin-right:20px;"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>
    
  </form>
  <!--<a style="display:inline-block;" class="btn btn-primary" href="javascript:history.go(-1);">返回</a>-->
  </div>
  
  <div class="page-container dataTables_wrapper">
      <div id="tab-system" class="HuiTab">
        <div class="tabCon">
          <div class="mt-20">
            <table
              class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
              <thead>
                <tr class="text-c">
                  <th>订单号</th>
                  <th>期号</th>
                  <th>会员</th>
                  <th>投注彩种</th>
                  <th>投注金额</th>
                  {if($ticker!=0)}
                    <th>追号退单/和值退单</th>
                    <th>中奖金额</th>
                  {/if}
                  <th>投注赔率</th>
                  <!-- <th>返点金额</th> -->
                  <th>玩法</th>
                  <th>投注号码</th>
                  <th>开奖结果</th>
                  <th>来源</th>
                  <th>状态</th>
                  <th>投注时间</th>
                {if $ticker==1}
                  <th>结算时间</th>
                {/if}
                 <!--  {if($ticker==3)}
                 <th>撤单</th>
                 {/if} -->
                </tr>
              </thead>
              <tbody>
              {volist name="query" id="item"}
                <tr class="text-c">
                  <td>{$item.uid}</td>
                  <td class="qihao_jc"><!-- <span style="color:green;"></span> -->{$item.qihao}</td>
                  <td {if condition="$item['nbzh'] == 1"}style="color:blue"{elseif condition="$item['swzh'] == 1"}style="color:red"{/if}>{$item.name}</td>
                  <td style='text-align:center' class="tzcz">{if condition="$item.new_name eq ''"}
			         {$item.old_name}
			         {else /}
			         {$item.new_name}
			         {/if}
		           </td>
                  <td>{$item.tzje}</td>
                  {if($ticker!=0)}
                    <td>
                    {$item.fdje}
                    </td>
                    <td class="f-14 td-manage">
          					{if condition="$item.ifqs eq 0"}
          					未结算
          					{else /}
          					{$item.zjje}
          					{/if}
                    </td>
                  {/if}
                  <!-- <td>{$item.dzje}</td> -->
                  <td>{$item.dqpl}</td>
                  <!-- <td>{$item.fdje}</td> -->
                  <!-- <td>{$item.tzhje}</td> -->
                  <td>
                 {if(in_array($item.czid,$gcsc) )}
                  {if(in_array($item.wfid,$ssc))}
	                  	(信)
	                  {else/}
	                  	(官)
	               {/if}
                  {/if}
                  
                  {$item.wanfa}
                  </td>
                 <td>
                   <a {if condition="$ticker eq 1"}onClick="showtzxq($uid={$item.uid});"{/if} title="{$item.tzhm}"  style='display:block; width:100px; margin:0 auto; text-align:center; background:none; border:none; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; word-break:keep-all;'>{$item.tzhm}</a>
                 </td>
                  <td>
                    {if(strlen($item.kjjg)>1)}
                    {$item.kjjg}
                    {else /}
                    未开
                    {/if}
                  </td>
                  <td>{if($item.method==1)}pc{/if}{if($item.method==2)}H5{/if}{if($item.method==3)}Android{/if}{if($item.method==4)}ios{/if}</td>
                  <td>{if condition="$item.ifqs eq 0"}
                      未结算
                      {else /}
                      {if($item.zjje>0.001)}
                      <span style="color:red;">已中奖</span>
                      {else/}
                      <span style="color:green;">未中奖</span>
                      {/if}
                      {/if}
                  </td>
                  <td>{$item.tz_time|date="Y-m-d H:i:s",###}</td>
                {if $ticker==1}
                   <td>{$item.rktime}</td>
                {/if}
                  <!-- <td style='text-align:center'>{if condition="$item.ifqs eq 0"}
                }
			        未结算
			        {else /}
			        {$item.zjzs}
			        {/if}
			      </td> -->
			      <!-- {if($ticker==3)}
                                <td><a href="{:url('betting/zhuihaoChedan')}?uid={$item.uid}">撤单</a></td>
                              {/if} -->
                </tr>
                {/volist}
              </tbody>
            </table>
          </div>
        </div>
      </div>
      <input type="hidden" value="{$ticker}" id="aaa">
       <div class="dataTables_paginate paging_simple_numbers" style="width:100%;">
	     <div style="float:left;">  
	     	每页显示<select name="limit" style="height:26px;" id="code">
	       		<option value="20" {if condition="$limit eq 20"}selected{/if}>
                20
              </option>
              <option value="50" {if condition="$limit eq 50"}selected{/if}>
                50
              </option>
              <option value="100" {if condition="$limit eq 100"}selected{/if}>
                100
              </option>
	       </select>页
       		</div>
            <span style="float:right;margin-left:-2px;">总共{$query->lastPage()}页  当前第{$query->currentPage()}页 ，共{$query->total()}条</span>
            <div style="float:left;">{$query->render()}</div>
    </div>
  </div>
  
  </div>
      
  </div>
{/block}

{block name="js"}
  <script type="text/javascript" src="__SYSMET__/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
  <script type="text/javascript">
  $("#code").on('change',function(){
		var id = $(this).find('option:selected').val();
    var username=$("#us_sql").val();
    var sDate2=$("#sDate2").val();
    var sDate1=$("#sDate1").val();
    var qihao=$("#qihao_sql").val();
    var ticker=$("#ticker").val();
		window.location.href="/admin/betting/tz_list?ticker={$ticker}&limit="+id;
	})
    $(function() {
      $('.skin-minimal input').iCheck({
        checkboxClass : 'icheckbox-blue',
        radioClass : 'iradio-blue',
        increaseArea : '20%'
      });
      $("#tab-system").Huitab({
        index : 0
      });
    });
    if($('#aaa').val()=='0'){
    	
    	var allQihao=document.getElementsByClassName('qihao_jc')
      var allTz=document.getElementsByClassName('tzcz')
	    for(var i=0;i<allQihao.length;i++){
	    	if(i!=(allQihao.length-1)){
	    		
	    		if(allTz[i].innerHTML==allTz[i+1].innerHTML){
	    			
		    		if(allQihao[i].innerHTML!=allQihao[i+1].innerHTML){
		    			allQihao[i].style.color='red'
		    			allTz[i].style.color='red'
		    		}
		    	}
	    	}
	    	
	    	
	    }
    }
function showtzxq(uid){
        
        
        var title="投注详情";
        var url="{:url('betting/tzxqlist')}?tzid="+$uid;
        var w="900";
        var h="250";
        layer_show(title,url,w,h);

    }
</script>

{/block}
